<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
	</body>
	<script>
		//1 
		var obj={
			name:"狗狗",
			sex:'男'
		}
		console.log(obj.name==undefined) //如果true 就是没有;
		console.log(obj.hasOwnProperty('name'))
		console.log('sex' in obj)
		//练习
		if(!'age' in obj){
			obj.age=18
		}
	</script>
</html>
